package com.bqdu.demo1.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bqdu.demo1.domain.SeckillCommodity;
import org.apache.ibatis.annotations.Update;

/**
 * @Entity com.bqdu.demo1.domain.SeckillCommodity
 */
public interface SeckillCommodityMapper extends BaseMapper<SeckillCommodity> {

    @Update("update seckill_commodity set stock=stock-1 where id = #{id} and stock > 0")
    boolean reduceStock(Long id);
}




